<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "user_fund_detail".
 *
 * @property int $id
 * @property int $userid 用户ID
 * @property int $type 资金记录类型，0:充值,1:购买商品，2:售出商品，3:获得分成收益,4:提现
 * @property string $money 金额
 * @property string $order_no 订单编号
 * @property string $pay_no 支付流水号
 * @property string $name 资金流水项目名称
 * @property int $addtime 添加时间
 */
class UserFundDetail extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user_fund_detail';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['userid', 'money', 'addtime'], 'required'],
            [['userid', 'order_no', 'addtime'], 'integer'],
            [['money'], 'number'],
            [['type'], 'string', 'max' => 5],
            [['pay_no'], 'string', 'max' => 60],
            [['name'], 'string', 'max' => 130],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'userid' => '用户ID',
            'type' => '资金记录类型，0:充值,1:购买商品，2:售出商品，3:获得分成收益,4:提现',
            'money' => '金额',
            'order_no' => '订单编号',
            'pay_no' => '支付流水号',
            'name' => '资金流水项目名称',
            'addtime' => '添加时间',
        ];
    }
}
